package name.as3.cmdFrameworks.manager.delegate
{
import flash.display.DisplayObject;
import flash.utils.SafeGlobalOwner;

import name.as3.cmdFrameworks.interfaces.IManager;
import name.as3.cmdFrameworks.interfaces.addins.IMediator;
import name.as3.cmdFrameworks.interfaces.addins.IMediatorAddin;
import name.as3.cmdFrameworks.interfaces.IMediatorManager;
import name.as3.cmdFrameworks.interfaces.IMediatorManagerDelegate;

public class MediatorManagerDelegate extends SafeGlobalOwner implements IMediatorManagerDelegate
{
	private var m_obManager:IMediatorManager;
	/**
	 *
	 */
	public function MediatorManagerDelegate()
	{
	}
//==================================================================================================
// public
//==================================================================================================
	public function set manager(value:IManager):void
	{
		m_obManager = IMediatorManager(value);
	}
	/**
	 * 获取管理器
	 */
	public function get manager():IManager
	{
		return m_obManager;
	}
	/**
	 * 添加中介
	 */
	public function addMediator(strType : String, 
								obMediator : IMediator,
								obView		: DisplayObject = null,
								obAddins		: Vector.<IMediatorAddin> = null,
								strAddins	: Vector.< Vector.<String> > = null,
								dataAddins	: Vector.< Vector.<Object> > = null):void
	{
		m_obManager.addMediator(strType, obMediator, obView, obAddins, strAddins, dataAddins);
	}
	/**
	 * 切换面板
	 */
	public function switchMediator(arrType : Array,
								   arrHide : Array,
								   strType : String, 
								   obMediator : IMediator, 
								   obView		: DisplayObject = null,
								   obAddins		: Vector.<IMediatorAddin> = null,
								   strAddins	: Vector.< Vector.<String> > = null,
								   dataAddins	: Vector.< Vector.<Object> > = null):void
	{
		m_obManager.switchMediator(arrType,
									arrHide,
									strType,
									obMediator,
									obView, 
									obAddins,
									strAddins,
									dataAddins);
	}
	/**
	 * 移除中介
	 */
	public function removeMediator(strType:String, blHide:Boolean=false):void
	{
		m_obManager.removeMediator(strType, blHide);
	}
	/**
	 * 获取中介
	 */
	public function getMediator(strType:String):IMediator
	{
		return m_obManager.getMediator(strType);
	}
}
}